//#import <Foundation/Foundation.h>
#include <iostream>

#include "ckr_spec_cpp_specs.h"
#include "ckr_spec_ConsoleSpecRunner.h"

using namespace std;

static void run_interactive();

int main (int argc, const char * argv[]) 
{
#pragma unused(argc)
#pragma unused(argv)

	NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	pool = pool;

	run_equality_comparison_specs();
	run_not_equal_comparison_specs();
	run_less_than_comparison_specs();
	run_less_than_or_equal_comparison_specs();
	run_greater_than_comparison_specs();
	run_greater_than_or_equal_comparison_specs();
	run_container_specs();
	run_between_comparison_specs();
	run_close_to_comparison_specs();
	run_within_comparison_specs();
	run_nullpointer_comparisons_specs();
	run_spec_runner_specs();
	run_context_pass_fail_time_specs();
	run_spec_listener_specs();
	run_stringUtil_specs();
	run_consoleSpecRunner_specs();

	run_interactive();
	return 0;
}

using namespace ckr;

void run_interactive()
{
//	PassingSpec passing;
//	passing.setDuration( 1.0 );
//
//	FailingSpec failing;
//	failing.setDuration( 0.5 );

	StdOutStreamSpecListener listener(cout);
	ConsoleSpecRunner runner( *(SpecRunner::getGlobalSpecRunner()) );
	runner.runAll( &listener );
	cout << endl;
	cout << listener.logStr() << endl;
	runner.printSummary( cout );
	runner.printFailingSpecs( cout );

//	runner.add( & passing );
//	runner.add( & failing );
//
//	do {
//		runner.processInput( cout, cin );
//	} while ( not runner.isQuitting() );
}

